<?php
if ($_COOKIE['userName'] || $_COOKIE['userID']){
	// 删除cookie，使用户登录状态失效
	setcookie("userName",$_COOKIE['userName'],time()-1);
	setcookie("userID",$_COOKIE['userID'],time()-1);
	echo "
            <script>
                alert('退出登录成功！');
                window.location.href='index.php';
            </script>
        ";
}else{

}